<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
          var persons = [
            {
                username: '张飞',
                sex: '男',
                salary: 50000
            },
            {
                username: '关羽',
                sex: '男',
                salary: 60000
            }
        ];

        var resArr = persons.map(function (val) {
            console.log(val);
            // 返回一个新的对象
            return { 
               ...val,
                salary:val.salary += 2000
             };
        });

        console.log(resArr);
    </script>
</body>
</html>